<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
    <script>
        class A {
            constructor(props) {
                this.name = props.name;
                this.age = props.age;
                this.sex = props.sex;
            }
            eat() {
                console.log(this.name + '吃火锅');
            }
        }

        class B extends A {
            constructor(props, like) {
                super(props);
                this.like = like;
            }
        }

        let b = new B({name: '小明', age: 18, sex: '女'}, '篮球');
        console.log(b);
        console.log(b.eat());
    </script>
</body>
</html>